<?php
namespace Home\Model;
use Think\Model;
use Think\Model\RelationModel;
class OrderModel extends RelationModel {
	 protected  $tableName  = 'order';
	 public  $_link = array(
         'Order_product' => array(
             'mapping_type'  => self::HAS_MANY,
             'class_name'    => 'Order_product',
             'foreign_key'   => 'order_id',
             'mapping_name'  => 'order_product',
             "mapping_fields"=>array("name","price","photo_x","num")
         ),
     );
}